package main.java.commands;

import java.util.ArrayList;

import org.xith3d.utility.commands.Command;
import org.xith3d.utility.commands.CommandException;
import org.xith3d.utility.commands.CommandLine;

import main.java.MainLoop;
import main.java.scenes.Screen_Login;
import main.java.scenes.TestScene;
import main.java.scenes.TestScene2;

/** Let you select a Scene to show
 * @author Sven Berger
 *
 */
public class CmdShowScene implements Command
{
	private MainLoop mainLoop;

	public CmdShowScene(MainLoop loop)
	{
		this.mainLoop=loop;
	}
	@Override
	public Object[] createParametersArray(final ArrayList<String> parameters) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String execute(final Object[] parameters) throws CommandException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String execute(final CommandLine commandLine) throws CommandException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String execute(final Boolean inputInfo, final Object[] parameters)
			throws CommandException {
		return null;
	}

	@Override
	public String execute(final Boolean inputInfo, final CommandLine commandLine)
			throws CommandException {
		String param="";
		if(commandLine.getParameters().size()>0) 
		{
				param=commandLine.getParameters().get(0);
		}
		
		if(param.equals("test"))this.mainLoop.registerScene(new TestScene());
		else if(param.equals("login"))this.mainLoop.registerScene(new Screen_Login());
		else if(param.equals("test2"))this.mainLoop.registerScene(new TestScene2());
		else return "Allowed Parameters: login, test(x)";
		return "Scene changed";
	}

	@Override
	public String getKey() {
		return "ShowScene";
	}

	@Override
	public int getNumParameters() {
		return 1;
	}

	@Override
	public String[] getParameterTypes() {
		final String[] param={"Scene Name )"};
		return param;
	}

}
